/**
 * 常用的正则验证
 * @author: leon
 * @create: 2017-11-17 14:17
 */

const reEmail = /^\w+[-+.\w]*@([a-z\d-]+\.)+[a-z]{2,5}$/i;
const reMobile = /^(13[0-9]|14[57]|15[012356789]|166|17[035678]|18[0-9]|19[89])\d{8}$/;
const rePass = /^[a-zA-Z0-9]{6,}$/;

export default {
    email (str) {
        return reEmail.test(str);
    },
    mobile (str) {
        return reMobile.test(str);
    },
    password (str) {
        return rePass.test(str);
    }
}
